import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)


const router = new VueRouter({
    routes: [{
            path: '/',
            redirect: { name: 'index' }
        },
        {
            name: 'homePage',
            path: '/homePage',
            component: () =>
                import ('@/views/homePage.vue'),
            children: [{
                    name: 'index',
                    path: '/index',
                    component: () =>
                        import ('@/views/index.vue')
                },
                {
                    name: 'info',
                    path: '/info',
                    component: () =>
                        import ('@/views/info.vue')
                },
                {
                    name: 'shop',
                    path: '/shop',
                    component: () =>
                        import ('@/views/shop.vue')
                },
                {
                    name: 'search',
                    path: '/search',
                    component: () =>
                        import ('@/views/search.vue')
                },
            ]
        },
        // 新闻列表
        {
            name: 'NewsList',
            path: '/NewsList',
            component: () =>
                import ('@/views/News/NewsList.vue')
        },
        // 图片列表
        {
            name: 'Newsgoodlist',
            path: '/Newsgoodlist/:id',
            component: () =>
                import ('@/views/News/Newsgoodlist.vue')
        },
        {
            name: 'ImgList',
            path: '/ImgList',
            component: () =>
                import ('@/views/Images/ImgList.vue')
        },
        // 商品列表
        {
            name: 'GoodsList',
            path: '/GoodsList',
            component: () =>
                import ('@/views/Goods/GoodsList.vue')
        },
        // 商品详情
        {
            name: 'goodInfo',
            path: '/goodInfo/:imgid',
            component: () =>
                import ('@/views/Goods/goodInfo.vue')
        },
        // 图文介绍
        {
            name: 'GoodDesc',
            path: '/GoodDesc/:id',
            component: () =>
                import ('@/components/GoodDesc.vue')
        },
        //图片详情页
        {
            name: 'ImgDetail',
            path: '/ImgDetail/:id',
            component: () =>
                import ('@/views/Images/ImgDetail.vue'),
            props: true
        },
        // 商品评论
        {
            name: 'goodcomment',
            path: '/goodcomment/:artid',
            component: () =>
                import ('../views/Goods/goodcomment.vue'),
            props: true
        },



    ]
});
export default router